package cn.edu.zut.internship.web.utils;

import cn.edu.zut.internship.bean.sys.SysUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;

public class UserInfoUtil{
    public static SysUser getUserInfo(){
        SysUser user = null;
        try {
            Subject subject = SecurityUtils.getSubject();
            Session session = subject.getSession();
            user =(SysUser)session.getAttribute("userInfo");
        }catch (Exception e){

        }
        return user;
    }
}
